﻿using ProtoBuf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZyGames.Framework.Model;

namespace ZyGames.DZPocker.Model
{
	/// <summary>
	/// 玩家下注记录新表（去掉了ID，添加了玩家昵称和玩家头像）
	/// </summary>
	[Serializable, ProtoContract]
	[EntityTable(CacheType.Dictionary, DbConfig.Data)]
	public class NewUserBetRecord : BaseEntity
	{
		public NewUserBetRecord()
			: base(false)
		{
		}
		public NewUserBetRecord(int id, int userId, string userName, string userHeadIcon, int tableId, string betType, int betNum)
			: this()
		{
			this.ID = id;
			UserID = userId;
			UserName = userName;
			UserHeadIcon = userHeadIcon;
			TableID = tableId;
			BetType = betType;
			BetNum = betNum;
		}
		[ProtoMember(1)]
		[EntityField(true)]
		public int ID { get; set; }

		/// <summary>
		/// 玩家ID
		/// </summary>        
		[ProtoMember(2)]
		[EntityField]
		public int UserID { get; set; }

		[ProtoMember(3)]
		[EntityField]
		public string UserName { get; set; }

		[ProtoMember(4)]
		[EntityField]
		public string UserHeadIcon { get; set; }

		/// <summary>
		/// GameTableData中的TableId
		/// </summary>        
		[ProtoMember(5)]
		[EntityField]
		public int TableID { get; set; }

		[ProtoMember(6)]
		[EntityField]
		public int Hand { get; set; }

		/// <summary>
		/// 下注类型 参考PositionPlayState
		/// </summary>        
		[ProtoMember(7)]
		[EntityField]
		public string BetType { get; set; }

		/// <summary>
		/// 下注筹码
		/// </summary>        
		[ProtoMember(8)]
		[EntityField]
		public int BetNum { get; set; }

		/// <summary>
		/// 回合数
		/// </summary>
		[ProtoMember(9)]
		[EntityField]
		public int Round { get; set; }

		/// <summary>
		/// 存的玩家ID
		/// </summary>
		[ProtoMember(10)]
		[EntityField]
		public int SavedByUserId { get; set; }

		protected override int GetIdentityId()
		{
			return ID;
		}
	}
}
